package com.hzqy.persistence.dao.epg;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.hzqy.persistence.dao.core.PersistenceDao;
import com.hzqy.web.vo.SysProductVo;
import com.hzqy.web.vo.epg.AcPopupsListVo;
import com.hzqy.web.vo.epg.AcUserBillVo;

@Repository
public class AcUserBillDao extends PersistenceDao<AcUserBillVo, Integer> {

	public int insertUserBill(AcUserBillVo aub) {
		return getSqlSession().insert(this.getNamespace() + "insertUserBill", aub);
	}
	public int selectUserBillCount(Map<String,Object> map) {
		return getSqlSession().selectOne(this.getNamespace() + "selectUserBillCount", map);
	}
	public List<AcUserBillVo> selectUserBillList(Map<String,Object> map){
		return getSqlSession().selectList(this.getNamespace() + "selectUserBillList", map);
	}
	public List<AcUserBillVo> selectUserBillExcelList(Map<String,Object> map){
		return getSqlSession().selectList(this.getNamespace() + "selectUserBillExcelList", map);
	}
	public int updateUserBill(AcUserBillVo aub) {
		return getSqlSession().update(this.getNamespace() + "updateUserBill",aub);
	}
	public List<SysProductVo> productDetailed() {
		Map<String,Object> map = new HashMap<String, Object>();
		return getSqlSession().selectList(this.getNamespace() + "productDetailed", map);
	}
	//查询该用户是否存在，用户id,产品id产品编号订购时间
	public int selectUserBillCountByUser(AcUserBillVo aub) {
		return getSqlSession().selectOne(this.getNamespace() + "selectUserBillCountByUser", aub);
	}
	public int selectUserBillIsExistByUser(AcUserBillVo aub) {
		return getSqlSession().selectOne(this.getNamespace() + "selectUserBillIsExistByUser", aub);
	}
	
	public int deleteUserBill(AcUserBillVo aub) {
		return getSqlSession().delete(this.getNamespace() + "deleteUserBill", aub);
	}
	
	public List<AcPopupsListVo> selectAcPopupsList(Map<String,Object> map){
		return getSqlSession().selectList(this.getNamespace() + "selectAcPopupsList", map);
	}
	
	public int selectAcPopupsCount(Map<String,Object> map) {
		return getSqlSession().selectOne(this.getNamespace() + "selectAcPopupsCount", map);
	}
}
